<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('订单发货列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>订单号：</label>
                                <input type="text" name="soCode"/>
                            </li>
                            <li>
                                <label>调入仓库：</label>
                                <input type="text" name="sofromwhname"/>
                            </li>
                            <li>
                                <label>调出仓库：</label>
                                <input type="text" name="sotowhname"/>
                            </li>
                            <li>
                                <label>编码：</label>
                                <input type="text" name="pcode"/>
                            </li>
                            <li>
                                <label>名称：</label>
                                <input type="text" name="pname"/>
                            </li>
                            <li>
                                <label>型号：</label>
                                <input type="text" name="pstd"/>
                            </li>
                            <li>
                                <label>发货数量：</label>
                                <input type="text" name="sendqty"/>
                            </li>
                            <li>
                                <label>物流编号：</label>
                                <input type="text" name="logcode"/>
                            </li>
                            <li>
                                <label>备注：</label>
                                <input type="text" name="smemo"/>
                            </li>
                            <li>
                                <label>发货单号：</label>
                                <input type="text" name="sendcode"/>
                            </li>
                            <li class="select-time">
                                <label>发货日期：</label>
                                <input type="text" class="time-input" autocomplete="off" id="startTime" placeholder="开始时间" name="params[beginSenddt]"/>
                                <span>-</span>
                                <input type="text" class="time-input" autocomplete="off" id="endTime" placeholder="结束时间" name="params[endSenddt]"/>
                            </li>
                            <li>
                                <label>状态：</label>
                                <select name="st">
                                    <option value="">所有</option>
                                    <option value="发货">发货</option>
                                    <option value="收货">收货</option>
                                </select>
                            </li>
                            <li>
                                <label>订单从表：</label>
                                <input type="text" name="idsos"/>
                            </li>
                            <li>
                                <label>收货人：</label>
                                <input type="text" name="recemp"/>
                            </li>
                            <li class="select-time">
                                <label>收货日期：</label>
                                <input type="text" class="time-input" autocomplete="off" id="startTime" placeholder="开始时间" name="params[beginRecdt]"/>
                                <span>-</span>
                                <input type="text" class="time-input" autocomplete="off" id="endTime" placeholder="结束时间" name="params[endRecdt]"/>
                            </li>
                            <li>
                                <label>是否厂家代发货：</label>
                                <select name="isreplace">
                                    <option value="">所有</option>
                                    <option value="是">是</option>
                                    <option value="否">否</option>
                                </select>
                            </li>
                            <li>
                                <label>是否生成金蝶单：</label>
                                <select name="kingst">
                                    <option value="">所有</option>
                                    <option value="1">是</option>
                                    <option value="0">否</option>
                                </select>
                            </li>
                            <li>
                                <label>发货仓库编码：</label>
                                <input type="text" name="fromwh"/>
                            </li>
                            <li>
                                <label>发货仓库名称：</label>
                                <input type="text" name="fromwhname"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:sossend:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="erp:sossend:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="erp:sossend:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:sossend:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('erp:sossend:edit')}]];
        var removeFlag = [[${@permission.hasPermi('erp:sossend:remove')}]];
        var prefix = ctx + "erp/sossend";

        $(function() {
            var options = {
                url: prefix + "/listNew",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "订单发货",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'soCode',
                    title: '订单号'
                }, {
                    field: 'sofromwhname',
                    title: '调入仓库'
                },{
                    field: 'sotowhname',
                    title: '调出仓库'
                },
                    {
                        field: 'itemcode',
                        title: '金蝶编码'
                    },
                {
                    field: 'pcode', 
                    title: '编码'
                },
                {
                    field: 'pname', 
                    title: '名称'
                },
                {
                    field: 'pstd', 
                    title: '型号'
                },
                {
                    field: 'sendqty', 
                    title: '发货数量'
                },
                {
                    field: 'logcode', 
                    title: '物流编号'
                },
                {
                    field: 'smemo', 
                    title: '备注'
                },
                {
                    field: 'sendcode', 
                    title: '发货单号'
                },
                {
                    field: 'senddt', 
                    title: '发货日期'
                },
                {
                    field: 'st', 
                    title: '状态'
                },
                {
                    field: 'recemp', 
                    title: '收货人'
                },
                {
                    field: 'recdt', 
                    title: '收货日期'
                },
                {
                    field: 'isreplace', 
                    title: '是否厂家代发货'
                },
                {
                    field: 'kingst', 
                    title: '是否生成金蝶单'
                },
                {
                    field: 'fromwh', 
                    title: '发货仓库编码'
                },
                {
                    field: 'fromwhname', 
                    title: '发货仓库名称'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        if(row.kingst == '否'){
                            actions.push('<a class="btn btn-warning btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="updateJDinfo(\'' + row.sendcode + '\')"><i class="fa fa-warning"></i>生单</a>');
                        }
                        /*actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');*/
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>